{extend name="layout:base" /}
{block name="main_content"}
  <div class="page-content">
    <!--主题-->
    <?php if(!empty($current_page)): ?>
      <div class="page-header">
        <h1>
          您当前操作
          <small>
            <i class="ace-icon fa fa-angle-double-right"></i>
            {$current_page.title|default=''}
          </small>
        </h1>
      </div>
    <?php endif; ?>
    <div class="row">
      <?php if(!empty($notice)): ?>
        <div class="alert alert-block alert-success">
          <button type="button" class="close" data-dismiss="alert">
            <i class="ace-icon fa fa-times"></i>
          </button>
          <i class="ace-icon fa fa-check green"></i>
          {$notice}
        </div>
      <?php endif; ?>
      <div class="col-xs-12">
        <div class="row maintop">
          <div class="col-xs-4 col-sm-2">
            <a href="{:url('create')}">
              <button class="btn btn-sm btn-primary">
                <i class="ace-icon fa fa-plus bigger-110"></i>
                添加管理员
              </button>
            </a>
          </div>
          <div class="col-xs-10 col-sm-5">
            <form name="form_search" class="form-search" method="get" action="{:url('index')}">
              <div class="input-group">
                <span class="input-group-addon">
                  <i class="ace-icon fa fa-check"></i>
                </span>
                <input type="text" name="keyword" id="keyword" class="form-control" value="{$param.keyword|default=''}" placeholder="请输入关键词" />
                <span class="input-group-btn">
                  <button type="submit" class="btn btn-purple btn-sm">
                    <span class="ace-icon fa fa-search icon-on-right bigger-110"></span>
                    搜索
                  </button>
                </span>
              </div>
            </form>
          </div>
          <div class="col-xs-4 col-sm-5">
            <div class="input-group-btn">
              <a href="{:url('index')}">
                <button type="button" class="btn btn-sm  btn-purple">
                  <span class="ace-icon fa fa-globe icon-on-right bigger-110"></span>
                  显示全部
                </button>
              </a>
            </div>
          </div>
        </div>

        <div class="row">
          <div class="col-xs-12">
            <form method="post" action="{:url('resort')}" >
              <table class="table table-striped table-bordered table-hover" id="dynamic-table">
                <thead>
                  <tr>
                    <th>用户ID</th>
                    <th>手机号码</th>
                    <th>用户昵称</th>
                    <th class="field-avatar">用户头像</th>
                    <th>管理员组名</th>
                    <!--
                    <th>用户级别</th>
                    <th>用户积分</th>
                    <th>用户元宝</th>
                    -->
                    <th>上次登录时间</th>
                    <th>上次登录IP</th>
                    <th class="center">锁定状态</th>
                    <th class="center">操作</th>
                  </tr>
                </thead>
                <tbody>
                  <?php $list = $res->all(); ?>
                  {volist name="$list" id="vo"}
                    <tr>
                      <td>
                        <a href="#">
                          {$vo.id}
                        </a>
                      </td>
                      <td>
                        <a href="#">
                          {$vo.mobile}
                        </a>
                      </td>
                      <td>
                        {$vo.nickname}
                      </td>
                      <td class="field-avatar">
                        <img src="{$site_root}{$vo|show_user_avatar_url=###}" class="img-circle" alt="{$vo.nickname}">
                      </td>
                      <td>
                        {$vo.manager_group_title}
                      </td>
                      <!--
                      <td>
                        {//$vo.member_group_title}
                      </td>
                      <td>
                        {$vo.active_score}/{$vo.total_score}
                      </td>
                      <td>
                        {$vo.active_coin}/{$vo.total_coin}
                      </td>
                      -->
                      <td>
                        {$vo.last_login_time|format_show_time=###}
                      </td>
                      <td>
                        <?php if($vo["last_login_ip"]){echo(long2ip($vo["last_login_ip"]));} ?>
                      </td>
                      <td class="center">
                        <?php if($vo["is_locked"]): ?>
                          <a class="red" href='javascript:void(0)' onclick="alert_del('{:url("unlock", array("id" => $vo["id"]))}', '确认要解锁吗？');" class="tooltip-error" data-rel="tooltip">
                            <i class="ace-icon fa fa-lock bigger-130"></i>锁定
                          </a>
                        <?php else: ?>
                          <a class="green" href='javascript:void(0)' onclick="alert_del('{:url("lock", array("id" => $vo["id"]))}', '确认要锁定吗？');" class="tooltip-error" data-rel="tooltip">
                            <i class="ace-icon fa fa-unlock bigger-130"></i>解锁
                          </a>
                        <?php endif; ?>
                      </td>
                      <td class="center">
                        <a class="green" href="{:url('edit', array('id' => $vo['id']))}">
                          <i class="ace-icon fa fa-pencil bigger-130"></i>编辑
                        </a>
                        <a class="green" href="{:url('change_type', array('id' => $vo['id']))}">
                          <i class="ace-icon fa fa-users bigger-130"></i>设置成普通用户
                        </a>
                      </td>
                    </tr>
                  {/volist} 
                </tbody>
              </table>
            </form>
            <div>
              <?php echo($res->render()); ?>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
{/block}